package org.tankwar.model;

import org.tankwar.view.GamePanel;

import java.awt.*;

public abstract class StaticGameComponent implements GameComponent{
    protected int x, y;
    protected GamePanel gamePanel;
    protected int width = 30, height = 30; // 默认宽和高都是30
    protected Image componentImage;
    protected boolean live = true;

    @Override
    public Rectangle getRect() {
        return new Rectangle(x, y, width, height);
    }

    public GamePanel getGamePanel() {
        return gamePanel;
    }

    public void setGamePanel(GamePanel gamePanel) {
        this.gamePanel = gamePanel;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public boolean isLive() {
        return live;
    }

    public void setLive(boolean live) {
        this.live = live;
    }
}
